package cn.java79.springcore;

import org.springframework.beans.factory.InitializingBean;

/**
 * @author oldliu
 * @since 1.0
 */
public class HelloSpring implements InitializingBean {
    private String name;
    private String words;

    public HelloSpring(){
        System.out.println("HelloSpring 被创建了。。。");
    }

    public HelloSpring(String name, String words) {
        this.name = name;
        this.words = words;
    }

    public void say(){
        System.out.println(name+"说："+words);
    }
    //set不能少，get看情况

    public void setName(String name) {
        System.out.println("set Name");
        this.name = name;
    }

    public void setWords(String words) {
        System.out.println("set  Words");
        this.words = words;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("Hello对象创建完成！");
    }
    public void begin(){
        System.out.println("今天是："+new java.util.Date()+"出门碰到"+name+"了");
    }
    public void bye(){
        System.out.println("和"+name+" say goodbye!");
    }

}
